package geometrie;

public class Triangle implements Figure {

	protected double cote1;
	protected double cote2;
	protected double cote3;

	@Override
	public double surface() {
		double perimetre = cote1+cote2+cote3;
		double dp = perimetre/2;
		double aire = Math.sqrt((dp-cote1)*(dp-cote2)*(dp-cote3)*dp);
		return aire;
	}

	public Triangle(double cote1, double cote2, double cote3) {
		super();
		this.cote1 = cote1;
		this.cote2 = cote2;
		this.cote3 = cote3;
	}

	public double getCote1() {
		return cote1;
	}

	public void setCote1(double cote1) {
		this.cote1 = cote1;
	}

	public double getCote2() {
		return cote2;
	}

	public void setCote2(double cote2) {
		this.cote2 = cote2;
	}

	public double getCote3() {
		return cote3;
	}

	public void setCote3(double cote3) {
		this.cote3 = cote3;
	}

	@Override
	public String toString() {
		return "Triangle [cote1=" + cote1 + ", cote2=" + cote2 + ", cote3="
		+ cote3 + "]";
	}



}
